package com.wfx.mapper;

import com.wfx.entity.WxbLoginLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhu
 * @since 2021-01-25
 */
public interface WxbLoginLogMapper extends BaseMapper<WxbLoginLog> {
    //统计每天的登录人数
    @Select("SELECT  DATE_FORMAT(login_time,'%Y-%m-%d')as dat, COUNT(distinct login_ip)as cunt from wxb_login_log GROUP BY DATE_FORMAT(login_time,'%y-%m-%d')")
    public List<Map> statLoginCountPersonPerDay();
    //统计每天的登录人次
    @Select("SELECT  DATE_FORMAT(login_time,'%Y-%m-%d')as dat, COUNT( login_ip)as cunt from wxb_login_log GROUP BY DATE_FORMAT(login_time,'%y-%m-%d')")
    public List<Map> statLoginCountPerDay();
}
